
<?php
	include"../connection.php";
	$sql="Select * from sanpham s,loaisanpham l,nhomsanpham n
	where s.MaLoai=l.MaLoai and l.MaNhom=n.MaNhom and l.MaNhom='8'
	order by NgayNhap
	LIMIT 0,3";
	$result=mysql_query($sql) or die("Cound not select to SanphamDB!".mysql_error($con));
	   echo"<table border='0'>";
	   echo"<tr>";
		while($row = mysql_fetch_array($result,MYSQL_ASSOC)){
			echo '<td>';
			echo '<div id="o_sanpham">';
				echo '<div class="giamgia">50%</div>';
				echo '<div class="hinhanh_minhhoa"><a href="#"><img width="180px" height="235px"src="'.$row["HinhAnhSP"].'" alt="image" /></a></div>';
				echo '<div class="tenthuonghieu"><a href="#">'.$row["TenSanPham"].'</a></div>';
				echo '<div class="details">';
					echo '<div class="gia"><span class="giacu">'.number_format($row['DonGiaDuKien'],3).' VNĐ</span> <br />';
					echo '<span class="giamoi">'.number_format($row['DonGiaDuKien'],3).' VNĐ</span></div>';
					echo '<a href="#"><div class="xemchitiet"></div></a>';
    			echo '</div>';
			echo '</div>';
			echo '</td>'; 
		}
		echo "</tr>";
		echo "</table>";	
	mysql_close($con);
?>
